const Sequelize = require('sequelize');

import sequelize from './db/sequelize';

/**
 * 单张图片实体
 */
const AccountDetail = sequelize.define('account_details', {
  id                    : {type: Sequelize.BIGINT,   allowNull: false, primaryKey: true, autoIncrement: true},
  uid                   : {type: Sequelize.STRING,   allowNull: false, unique:'account_uid_index' },
  
  icon                  : {type: Sequelize.STRING,   allowNull: true },
  nickname              : {type: Sequelize.STRING,   allowNull: true },
  phone                 : {type: Sequelize.STRING,   allowNull: true },

  // address_id            : {type: Sequelize.STRING,   allowNull: true },
  // personal_id           : {type: Sequelize.STRING,   allowNull: true },
  // company_id            : {type: Sequelize.STRING,   allowNull: true },

  ext                   : {type: Sequelize.TEXT,     allowNull: true },
  remark                : {type: Sequelize.STRING,   allowNull: true },
  status                : {type: Sequelize.INTEGER,  allowNull: false, defaultValue: 1},

},
{
    charset: 'utf8'
});

AccountDetail.sync({force: false}).then(function(){});
export default AccountDetail;